import pytest

from Auto.day02.register.Register_Operation import Register_Operation
from Auto.day02.register.Register_Data import Register_Data
from utils.ReadYaml import ReadYaml
from utils.XLUtils import XLUtils

class Test_Register(Register_Operation):

    # data类
    @pytest.mark.parametrize("username,password,re_password,expect",Register_Data.Register_Data)
    def test_register(self,driver,register_page,username,password,re_password,expect):
        result = self.getSuccessResult(driver)
        self.asserttitle(driver,result,expect)
    # yaml类
    @pytest.mark.parametrize("username,password,re_password,expect",
                             ReadYaml.read_yaml("D:\Python\Project\project01\Auto\day02\data.yaml")['register'])
    def test_register2(self, driver, register_page, username, password, re_password, expect):
        result = self.getSuccessResult(driver)
        self.asserttitle(driver, result, expect)
    # excel类
    @pytest.mark.parametrize("username,password,re_password,expect",
                             XLUtils.read_excel("D:\Python\Project\project01\Auto\day02\data.xlsx","register"))
    def test_register3(self, driver, register_page, username, password, re_password, expect):
        result = self.getSuccessResult(driver)
        self.asserttitle(driver, result, expect)
